]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Clear clipboard on lock
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 16 May 2013 15:51:31 +0000 (17:51 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 5 Jun 2013 14:22:27 +0000 (16:22 +0200)
Currently the clipboard's contents may leak to unauthorized parties by
pasting into the unlock dialog's password entry and unmasking the entry.
Prevent this from happening by clearing the clipboard on lock.

https://bugzilla.gnome.org/show_bug.cgi?id=698922

js/ui/screenShield.js

index 185f109c7074b92350e944a15050f841a418d206..254bc68ada9b24e50607bb6aee584b01e2918976 100644 (file)
@@ -1215,6 +1215,12 @@ const ScreenShield = new Lang.Class({
             return;
         }
 
+        // Clear the clipboard - otherwise, its contents may be leaked
+        // to unauthorized parties by pasting into the unlock dialog's
+        // password entry and unmasking the entry
+        St.Clipboard.get_default().set_text(St.ClipboardType.CLIPBOARD, '');
+        St.Clipboard.get_default().set_text(St.ClipboardType.PRIMARY, '');
+
         this._isLocked = true;
         this.activate(animate);